﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Entity;
namespace Web.admin.news
{
    public partial class show : System.Web.UI.Page
    {
        BLL.NewsContent newscontent = new BLL.NewsContent();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) {
                if (Request.QueryString["id"] != null) {
                    InforBind(Request.QueryString["id"]);
                }
            }
        }
        /// <summary>
        /// 根据id来绑定数据
        /// </summary>
        /// <param name="id">id号</param>
        protected void InforBind(string id) {
            BoNewsContent model = newscontent.GetNewsSingle(id);
            if (model != null)
            {
                lbTitle.Text = model.NewsTitle;
                lbFrom.Text =model.NewsAuthor;
                lbClass.Text = model.NCTitle;
                lbUrl.Text = model.NewsImgUrl;
                lbContent.Text = model.NewsArticle;
                if (model.NewsIsShow == true)
                    lbIsLock.Text = "已审核";
                else
                    lbIsLock.Text = "未审核";
                lbPubTime.Text = model.NewspubTime.ToShortDateString();
            }
            
            
        }
        
    }
}